<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Facades\Log;

class Sms extends Model
{

    use SoftDeletes;

    protected $table = 'sms';

    public static function sendOrderMsg($order)
    {
        $name = '';
        $phone = '';
        $param = [
            'templet_id' => 'SMS_169637573',
            'mobile' => $order['receive_mobile'],
            'content' => [
                'code' => $order['code'],
                'name' => $name,
                'phone' => $phone,
            ],
            'ip' => '',
        ];
        if(!$result = sms_send($param)){
            Log::info($param['templet_id'].'-'.$param['mobile'].'短信发送失败');
        }
    }
}
